package com.kusen.village.raise.topic;

import java.util.ArrayList;
import java.util.List;

/**
 * @description: 分拣类。维护所有的topic
 * @author: ghl
 * @create: 2021-10-13 11:02
 **/
public class TopicStaff {
private List<TopicInterface> topicInterfaces=new ArrayList<>();

    /**
     * 添加要处理的topic
     * @author: ghl
     * @create: 2021-10-13 11:02
     */
    public void addTopic(TopicInterface topic){
    topicInterfaces.add(topic);
     }

    /**
     *使用包装类来处理topic的任务
     * @author: ghl
     * @create: 2021-10-13 11:02
     */
    public void handTopic(String topic,String jsonData){
        for (TopicInterface topicInterface : topicInterfaces) {
             topicInterface.handTopic(topic,jsonData);
        }
     }
}
